package com.cys.markdown.doc.project.interfaces.service;

import com.cys.markdown.doc.project.interfaces.entity.IProjectRelUser;
import com.cys.mid.core.system.interfaces.entity.ISysUser;
import com.github.pagehelper.PageInfo;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * T_PROJECT_REL_USER【项目用户关联表】 Service接口
 *
 * @author caiyushen
 */
@Transactional
public interface ProjectRelUserService {

    /**
     * 新增ProjectRelUser
     *
     * @param params ProjectRelUser实体类对应参数
     * @return ProjectRelUser实体类
     */
    IProjectRelUser save(Map<String, Object> params) throws Exception;

    /**
     * 新增ProjectRelUser
     *
     * @param projectRelUser ProjectRelUser实体类对应参数
     */
    IProjectRelUser save(IProjectRelUser projectRelUser);

    /**
     * 批量新增
     *
     * @param dataList
     */
    void saveBatch(List<IProjectRelUser> dataList);

    /**
     * 批量关联ProjectRelUser
     *
     * @param projectInfoIdList 关联项目主键
     * @param sysUserId         用户主键
     */
    void saveBatchRelUser(List<Long> projectInfoIdList, Long sysUserId);


    /**
     * 批量关联ProjectRelUser
     *
     * @param projectInfoId 关联项目主键
     * @param sysUserIdList 用户主键列表
     */
    void saveBatchRelProject(Long projectInfoId, List<Long> sysUserIdList);

    /**
     * 修改ProjectRelUser
     *
     * @param params ProjectRelUser实体类对应参数
     * @return ProjectRelUser实体类
     */
    IProjectRelUser update(Map<String, Object> params) throws Exception;

    /**
     * 通过id物理删除ProjectRelUser
     *
     * @param id ProjectRelUser主键
     */
    void deleteById(Long id);

    /**
     * 批量物理删除ProjectRelUser
     *
     * @param ids ProjectRelUser主键数组
     */
    void deleteBatch(Long[] ids);

    /**
     * 根据id加载ProjectRelUser
     *
     * @param id ProjectRelUser主键
     * @return ProjectRelUser实体类
     */
    IProjectRelUser find(Long id);

    /**
     * 根据用户主键/项目主键 加载ProjectRelUser
     *
     * @param sysUserId     用户主键
     * @param projectInfoId 项目主键
     * @return ProjectRelUser实体类
     */
    IProjectRelUser find(Long sysUserId, Long projectInfoId);


    /**
     * 获取ProjectRelUser列表数据
     *
     * @param map 默认空数据集
     * @return 数据列表
     */
    List<IProjectRelUser> findList(Map<String, Object> map);

    /**
     * 分页获取数据
     *
     * @param pageNo   当前页
     * @param pageSize 当前页数
     * @param params   检索参数
     * @return 分页数据
     */
    PageInfo<IProjectRelUser> findPage(Integer pageNo, Integer pageSize, Map<String, Object> params);

    /**
     * 获取ProjectRelUser列表数据
     *
     * @param projectInfoId 项目信息主键
     * @return 数据列表
     */
    List<ISysUser> findUserListByProjectInfoId(Long projectInfoId);

    /**
     * 获取ProjectRelUser列表数据
     *
     * @param projectInfoId 项目信息主键
     * @param sysUserName   用户名称
     * @return 数据列表
     */
    PageInfo<ISysUser> findUserPageByProjectInfoId(Integer pageNo, Integer pageSize, Long projectInfoId, String sysUserName);

    /**
     * 根据项目id获取未关联项目的用户分页列表
     *
     * @param pageNo              当前页
     * @param pageSize            当前页显示的数据量
     * @param param-sysUserName   用户名称
     * @param param-projectInfoId 项目主键
     */
    PageInfo<ISysUser> findNotRelateUserPage(Integer pageNo, Integer pageSize, Map param);

    /**
     * 根据项目id获取关联关系
     *
     * @param projectInfoId 项目主键
     * @return
     */
    List<IProjectRelUser> findListByProjectInfoId(Long projectInfoId);

}
 



